#include<iostream>
#include<vector>
#include<cstdlib>
#include<ctime>
using namespace std;

int getRandom(vector<int>& a, int left, int right)
{
	int r = rand();
	return a[r % (right - left + 1) + left];
}
void quick_sort(vector<int>& a, int l, int r)
{
	if(l >= r) return;
	
	int key = getRandom(a, l, r);
	int left = l - 1, right = r + 1, i = l;
	while(i < right)
	{
		if(a[i] < key) swap(a[++left], a[i++]);
		else if(a[i] == key) i++;
		else swap(a[--right], a[i]);
	}
	
	//[l, left][left + 1, right - 1] [right, r]
	quick_sort(a, l, left);
	quick_sort(a, right, r);
}
int main()
{
	int n = 0;
	cin >> n;
	srand(time(NULL));
	vector<int> arr(n);
	for(int i = 0; i < n; i++) cin >> arr[i];
	quick_sort(arr, 0, n - 1);
	for(int i = 0; i < n; i++) cout << arr[i] << " ";
	return 0;
} 
